<?php

use Illuminate\Database\Seeder;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Hash;

class InitSeeder extends Seeder
{
    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {

        // bbs_admin_users
        $password = Hash::make('admin');
        DB::insert('insert into bbs_admin_users (`id`, `username`, `password`, `name`) values (?, ?, ?, ?)', [1, 'admin', $password, 'admin']);


        // bbs_admin_menu
        DB::insert('insert into bbs_admin_menu (`id`, `parent_id`, `order`, `title`, `icon`, `uri`, `show`) values (?, ?, ?, ?, ?, ?, ?)', [1, 0, 1, 'Index', 'feather icon-bar-chart-2', '/', 1]);
        DB::insert('insert into bbs_admin_menu (`id`, `parent_id`, `order`, `title`, `icon`, `uri`, `show`) values (?, ?, ?, ?, ?, ?, ?)', [2, 0, 2, 'Admin', 'feather icon-settings', '', 1]);
        DB::insert('insert into bbs_admin_menu (`id`, `parent_id`, `order`, `title`, `icon`, `uri`, `show`) values (?, ?, ?, ?, ?, ?, ?)', [3, 2, 3, 'Users', 'feather icon-bar-chart-2', 'auth/users', 1]);
        DB::insert('insert into bbs_admin_menu (`id`, `parent_id`, `order`, `title`, `icon`, `uri`, `show`) values (?, ?, ?, ?, ?, ?, ?)', [4, 2, 4, 'Roles', '', 'auth/roles', 1]);
        DB::insert('insert into bbs_admin_menu (`id`, `parent_id`, `order`, `title`, `icon`, `uri`, `show`) values (?, ?, ?, ?, ?, ?, ?)', [5, 2, 5, 'Permission', '', 'auth/permissions', 1]);
        DB::insert('insert into bbs_admin_menu (`id`, `parent_id`, `order`, `title`, `icon`, `uri`, `show`) values (?, ?, ?, ?, ?, ?, ?)', [6, 2, 6, 'Menu', '', 'auth/menu', 1]);
        DB::insert('insert into bbs_admin_menu (`id`, `parent_id`, `order`, `title`, `icon`, `uri`, `show`) values (?, ?, ?, ?, ?, ?, ?)', [7, 0, 11, '广告', 'fa-image', '', 1]);
        DB::insert('insert into bbs_admin_menu (`id`, `parent_id`, `order`, `title`, `icon`, `uri`, `show`) values (?, ?, ?, ?, ?, ?, ?)', [8, 7, 12, '广告分类', '', 'picture_category', 1]);
        DB::insert('insert into bbs_admin_menu (`id`, `parent_id`, `order`, `title`, `icon`, `uri`, `show`) values (?, ?, ?, ?, ?, ?, ?)', [9, 7, 13, '图片', '', 'picture', 1]);
        DB::insert('insert into bbs_admin_menu (`id`, `parent_id`, `order`, `title`, `icon`, `uri`, `show`) values (?, ?, ?, ?, ?, ?, ?)', [10, 0, 14, '文章', 'fa-book', '', 1]);
        DB::insert('insert into bbs_admin_menu (`id`, `parent_id`, `order`, `title`, `icon`, `uri`, `show`) values (?, ?, ?, ?, ?, ?, ?)', [11, 10, 15, '文章分类', '', 'article_category', 1]);
        DB::insert('insert into bbs_admin_menu (`id`, `parent_id`, `order`, `title`, `icon`, `uri`, `show`) values (?, ?, ?, ?, ?, ?, ?)', [12, 10, 16, '文章列表', '', 'article', 1]);
        DB::insert('insert into bbs_admin_menu (`id`, `parent_id`, `order`, `title`, `icon`, `uri`, `show`) values (?, ?, ?, ?, ?, ?, ?)', [13, 0, 17, '配置', 'fa-cogs', '/', 1]);
        DB::insert('insert into bbs_admin_menu (`id`, `parent_id`, `order`, `title`, `icon`, `uri`, `show`) values (?, ?, ?, ?, ?, ?, ?)', [14, 13, 18, '基础配置', '', 'admin_config', 1]);
        DB::insert('insert into bbs_admin_menu (`id`, `parent_id`, `order`, `title`, `icon`, `uri`, `show`) values (?, ?, ?, ?, ?, ?, ?)', [15, 0, 18, '帖子', 'fa-align-justify', '', 1]);
        DB::insert('insert into bbs_admin_menu (`id`, `parent_id`, `order`, `title`, `icon`, `uri`, `show`) values (?, ?, ?, ?, ?, ?, ?)', [16, 15, 18, '帖子分类', '', 'topic_category', 1]);
        DB::insert('insert into bbs_admin_menu (`id`, `parent_id`, `order`, `title`, `icon`, `uri`, `show`) values (?, ?, ?, ?, ?, ?, ?)', [17, 15, 18, '帖子列表', '', 'topic', 1]);
        DB::insert('insert into bbs_admin_menu (`id`, `parent_id`, `order`, `title`, `icon`, `uri`, `show`) values (?, ?, ?, ?, ?, ?, ?)', [20, 0, 19, '用户', 'fa-user', '', 1]);
        DB::insert('insert into bbs_admin_menu (`id`, `parent_id`, `order`, `title`, `icon`, `uri`, `show`) values (?, ?, ?, ?, ?, ?, ?)', [21, 20, 20, '用户列表', '', 'user', 1]);

        // bbs_admin_permissions
        DB::insert('insert into bbs_admin_permissions (`id`, `name`, `slug`, `http_path`, `order`, `parent_id`) values (?, ?, ?, ?, ?, ?)', [1, 'Auth management', 'auth-management', '', 1, 0]);
        DB::insert('insert into bbs_admin_permissions (`id`, `name`, `slug`, `http_path`, `order`, `parent_id`) values (?, ?, ?, ?, ?, ?)', [2, 'Users', 'users', '/auth/users*', 2, 1]);
        DB::insert('insert into bbs_admin_permissions (`id`, `name`, `slug`, `http_path`, `order`, `parent_id`) values (?, ?, ?, ?, ?, ?)', [3, 'Roles', 'roles', '/auth/roles*', 3, 1]);
        DB::insert('insert into bbs_admin_permissions (`id`, `name`, `slug`, `http_path`, `order`, `parent_id`) values (?, ?, ?, ?, ?, ?)', [4, 'Permissions', 'permissions', '/auth/permissions*', 4, 1]);
        DB::insert('insert into bbs_admin_permissions (`id`, `name`, `slug`, `http_path`, `order`, `parent_id`) values (?, ?, ?, ?, ?, ?)', [5, 'Menu', 'menu', '/auth/menu*', 5, 1]);

        // bbs_admin_role_users
        DB::insert('insert into bbs_admin_role_users (`role_id`, `user_id`) values (?, ?)', [1, 1]);

        // bbs_admin_roles
        DB::insert('insert into bbs_admin_roles (`id`, `name`, `slug`) values (?, ?, ?)', [1, 'Administrator', 'administrator']);


    }
}
